﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;


namespace test_knowledge.Model
{
    class DBInitializer: DropCreateDatabaseAlways<Context>
    {
        protected override void Seed(Context context)
        {
       
                Client client1 = new Client { Name = "Tom", Surname = "Hanks" };
                Client client2 = new Client { Name = "Bill", Surname = "Clinton" };
                Client client3 = new Client { Name = "Monica", Surname = "Belucci" };
                Client client4 = new Client { Name = "Vasya", Surname = "Puppkoff" };

                context.Clients.Add(client1);
                context.Clients.Add(client2);
                context.Clients.Add(client3);
                context.Clients.Add(client4);

                Good good1 = new Good { Name = "Milk", Price = 5 };
                Good good2 = new Good { Name = "Bread", Price = 3 };
                Good good3 = new Good { Name = "Honey", Price = 12 };
                Good good4 = new Good { Name = "Potato", Price = 2 };
                Good good5 = new Good { Name = "Meat", Price = 15 };

                context.Goods.Add(good1);
                context.Goods.Add(good2);
                context.Goods.Add(good3);
                context.Goods.Add(good4);
                context.Goods.Add(good5);

                Busket busket1 = new Busket { ClientId = 4, GoodId = 0, Count = 5, Date = new DateTime(2015, 12, 10) };
                Busket busket2 = new Busket { ClientId = 4, GoodId = 2, Count = 3, Date = new DateTime(2015, 12, 11) };

                Busket busket3 = new Busket { ClientId = 1, GoodId = 3, Count = 10, Date = new DateTime(2015, 12, 12) };
                Busket busket4 = new Busket { ClientId = 1, GoodId = 4, Count = 2, Date = new DateTime(2015, 12, 13) };

                Busket busket5 = new Busket { ClientId = 2, GoodId = 3, Count = 6, Date = new DateTime(2015, 12, 14) };
                Busket busket6 = new Busket { ClientId = 2, GoodId = 1, Count = 5, Date = new DateTime(2015, 12, 15) };

                Busket busket7 = new Busket { ClientId = 3, GoodId = 0, Count = 2, Date = new DateTime(2015, 12, 16) };
                Busket busket8 = new Busket { ClientId = 3, GoodId = 4, Count = 3, Date = new DateTime(2015, 12, 17) };

                context.Buskets.Add(busket1);
                context.Buskets.Add(busket2);
                context.Buskets.Add(busket3);
                context.Buskets.Add(busket4);
                context.Buskets.Add(busket5);
                context.Buskets.Add(busket6);
                context.Buskets.Add(busket7);
                context.Buskets.Add(busket8);
                base.Seed(context);
            
        }

    }
}
